Xbasic

property_from_json Function

Syntax

property_from_json(p prop, c jsonText[,c Stringize_fields])

Arguments

propPointer

The pointer variable to populate with the data from the JSON text.

jsonTextCharacter

The JSON to parse.

Stringize_fieldsCharacter

A comma separated list of field names to keep as JSON if they are stored as objects or arrays.

Description

The property_from_json() requires proper JSON, but is 2 to 5 times faster than json_parse()

Example

dim ptr as p
property_from_json(ptr,"{ foo : 1}")
Error parsing json: Name of an object member must be a string

property_from_json(ptr,"{ \"foo\" : 1}")
? ptr.foo
= 1

See Also